<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
       <div style="width: 76%; height: 20%; margin-left: 22%">
                <h:form id="form">  
                    
                    <c:if test="#{registerBean.registerLogin == null}">
                            <h:outputText class="mauchu" value="UserName: "></h:outputText>
                            <p:inputText id="uName" style="width: 14%; height: 14px; font-size: 12px" value="#{registerBean.registerEntities.userName}" ></p:inputText>
                            <h:outputText style="margin-left: 5px" class="mauchu" value="Password: "></h:outputText>
                            <p:inputText id="uPassword" style="width: 14%; height: 14px; font-size: 12px" value="#{registerBean.registerEntities.password}" ></p:inputText>
                            <h:commandButton action="#{registerBean.checkLogin()}" style="margin-left: 5px" class="cssbutton" value="Login"></h:commandButton>
                            </c:if>
                             
                            
                            <c:if test="#{registerBean.registerLogin != null}">
                                <h:commandLink style="margin-left: 5px; font-size: 13px; color: blue" class="mauchu" action="#{registerBean.urlRegister()}" value="Register"></h:commandLink>
                                
                            </c:if>
                    <p:dataGrid var="event" value="#{eventBean.eventList}" columns="3" 
                    rows="12" paginator="true"  
                    paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                    rowsPerPageTemplate="9,12,15">  

                        <p:panel header="#{event.eventName}" style="font-size: 12px">  
                            <h:panelGrid columns="1">     
                                <h:outputText value="Address: #{event.address}" />  
                                <h:outputText value="Start Date: #{event.startDate}" /> 
                                <h:outputText value="End Date: #{event.endDate}" /> 
                                <h:outputText value="Price: #{event.price}" /> 
                                <h:outputText value="Name Win: #{event.nameWin}" /> 

                                <p:commandLink update=":form:carDetail" oncomplete="eventDialog.show()" title="View Detail">  
                                    <h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" />   
                                    <f:setPropertyActionListener value="#{event}"   target="#{eventBean.eventEntities}" />  
                                </p:commandLink>  
                            </h:panelGrid>  
                        </p:panel>  

                    </p:dataGrid>  

                    <p:dialog header="Event Detail" widgetVar="eventDialog" width="422" modal="true">  
                        <p:outputPanel id="carDetail"  layout="block">  

                            <h:panelGrid id="display" columns="2" cellpadding="4"> 
                                        <h:outputText value="Event Name: " />  
                                        <h:outputText value="#{eventBean.eventEntities.eventName}" id="eventName"/>
                                        <h:outputText value="Start Date: " />  
                                        <h:outputText value="#{eventBean.eventEntities.startDate}" id="startDate"/>
                                        <h:outputText value="End Date: " />  
                                        <h:outputText value="#{eventBean.eventEntities.endDate}" id="endDate"/>
                                        <h:outputText value="Address: " />  
                                        <h:outputText value="#{eventBean.eventEntities.address}" id="address"/>
                                        <h:outputText value="Description: " />  
                                        <h:outputText value="#{eventBean.eventEntities.description}" id="description"/>
                                        <h:outputText value="Price: " />  
                                        <h:outputText value="#{eventBean.eventEntities.price}" id="price"/>
                                        <h:outputText value="Name Win: " />  
                                        <h:outputText value="#{eventBean.eventEntities.nameWin}" id="nameWin"/>
                            </h:panelGrid>
                        </p:outputPanel>  
                    </p:dialog>  

                </h:form>
            </div>
    </h:body>
</html>
